﻿package 
{

	import flash.display.MovieClip;

	public class LevelHandler extends MovieClip
	{

		public var currentLevel:Number = 1;
		private var lvlArray1:Array = new Array();
		private var lvlArray2:Array = new Array();
		private var X:String = "MAIN";
		private var G:String = "GOAL";

		public function LevelHandler()
		{
			init();
		}
		private function init()
		{
			currentLevel = 1;
			populateLevel1();
		}
		public function getCurrentLevel():Array
		{
			var lvlArray:Array = this['lvlArray'+currentLevel];
			return lvlArray;
		}
		private function populateLevel1()
		{
			var i:int;
			var j:int;

			for (i=0; i<14; i++)
			{
				lvlArray1[i] = new Array();
				/*for (j=0; j<20; j++) {
					if (i==0 || j==0 || j==19) {
						lvlArray1[i].push(1);
					}
					else {
						lvlArray1[i].push(0);
					}
				}*/
			}
			 lvlArray1[0].push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
			 lvlArray1[1].push(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[2].push(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[3].push(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[4].push(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[5].push(1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[6].push(1,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[7].push(1,1,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[8].push(1,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			 lvlArray1[9].push(1,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			lvlArray1[10].push(1,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);			
			lvlArray1[11].push(1,X,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			lvlArray1[12].push(1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
			lvlArray1[13].push(1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,G,0,0,0,0,0,1);
		}
	}
}